home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / phpMyAdmin / scripts / remove_control_m.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2003-11-18  |  396b  |  24 lines

  1. #!/bin/sh
  2. #
  3. # $Id: remove_control_m.sh,v 2.0 2003/11/18 15:20:45 nijel Exp $
  4. #
  5. # Script to remove ^M from files for DOS <-> UNIX conversions
  6. #
  7.  
  8. if [ $# != 1 ]
  9. then
  10.   echo "Usage: remove_control_m.sh <extension of files>"
  11.   echo ""
  12.   echo "Example: remove_control_m.sh php3"
  13.   exit
  14. fi
  15.  
  16. for i in `find . -name "*.$1"`
  17.      do 
  18.      echo $i
  19.      tr -d '\015' < $i > ${i}.new
  20.      rm $i
  21.      mv ${i}.new $i
  22.     done;
  23.  
  24.